package com.linefly.online_car.Custom;

import android.content.Context;
import android.content.Intent;

import com.linefly.online_car.LoginActivity;

import cn.pedant.SweetAlert.SweetAlertDialog;

/**
 * Created by liheng on 2018/12/18.
 */

public class ReLogin {
    public static void login(final Context context){

        new SweetAlertDialog(context)
                .setTitleText("请重新登录")
                .setConfirmText("确定")
                .setCancelText("取消")
                .setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
                    @Override
                    public void onClick(SweetAlertDialog sDialog) {
                        sDialog.dismissWithAnimation();
                        Intent intent = new Intent(context, LoginActivity.class);
                        context.startActivity(intent);

                    }
                })
                .setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
                    @Override
                    public void onClick(SweetAlertDialog sweetAlertDialog) {
                        sweetAlertDialog.dismissWithAnimation();

                    }
                })
                .show();
    }
}
